# -*- coding: utf-8 -*-
# @Author : Yuan


class UsernameConverter:
    # regex = '^[a-zA-Z0-9_-]{5,20}$'  会有问题
    regex = '[a-zA-Z0-9_-]{5,20}'

    def to_python(self, value):
        return value

    def to_url(self, value):
        return str(value)


class MobileConverter:
    regex = '1[345789]\d{9}'

    def to_python(self, value):
        return value

    def to_url(self, value):
        return str(value)


class UuidConverter:
    regex = '[\w-]+'

    def to_python(self, value):
        return value

    def to_url(self, value):
        return str(value)

